﻿
namespace ShareMarking.Entity
{
    using System;


    /// <summary>
    /// 表名：qr_record 主键列：record_id
    /// </summary>
    [SerializableAttribute()]
    public partial class qr_record : MySoft.Data.Entity
    {

        protected Int32 _record_id;

        protected Int32 _qr_DiyCode_id;

        protected String _Ip;

        protected String _Ipaddress;

        protected DateTime? _CreateOn;

        /// <summary>
        /// 扫码记录ID
        /// </summary>
        public Int32 record_id
        {
            get
            {
                return this._record_id;
            }
            set
            {
                this.OnPropertyValueChange(_.record_id, _record_id, value);
                this._record_id = value;
            }
        }

        /// <summary>
        /// 关联自定义二维码id
        /// </summary>
        public Int32 qr_DiyCode_id
        {
            get
            {
                return this._qr_DiyCode_id;
            }
            set
            {
                this.OnPropertyValueChange(_.qr_DiyCode_id, _qr_DiyCode_id, value);
                this._qr_DiyCode_id = value;
            }
        }

        /// <summary>
        /// ip端口
        /// </summary>
        public String Ip
        {
            get
            {
                return this._Ip;
            }
            set
            {
                this.OnPropertyValueChange(_.Ip, _Ip, value);
                this._Ip = value;
            }
        }

        /// <summary>
        /// ip地址
        /// </summary>
        public String Ipaddress
        {
            get
            {
                return this._Ipaddress;
            }
            set
            {
                this.OnPropertyValueChange(_.Ipaddress, _Ipaddress, value);
                this._Ipaddress = value;
            }
        }

        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime? CreateOn
        {
            get
            {
                return this._CreateOn;
            }
            set
            {
                this.OnPropertyValueChange(_.CreateOn, _CreateOn, value);
                this._CreateOn = value;
            }
        }

        /// <summary>
        /// 获取实体对应的表名
        /// </summary>
        protected override MySoft.Data.Table GetTable()
        {
            return new MySoft.Data.Table<qr_record>("qr_record");
        }

        /// <summary>
        /// 获取实体中的标识列
        /// </summary>
        protected override MySoft.Data.Field GetIdentityField()
        {
            return _.record_id;
        }

        /// <summary>
        /// 获取实体中的主键列
        /// </summary>
        protected override MySoft.Data.Field[] GetPrimaryKeyFields()
        {
            return new MySoft.Data.Field[] {
    					_.record_id};
        }

        /// <summary>
        /// 获取列信息
        /// </summary>
        protected override MySoft.Data.Field[] GetFields()
        {
            return new MySoft.Data.Field[] {
    					_.record_id,
    					_.qr_DiyCode_id,
    					_.Ip,
    					_.Ipaddress,
    					_.CreateOn};
        }

        /// <summary>
        /// 获取列数据
        /// </summary>
        protected override object[] GetValues()
        {
            return new object[] {
    					this._record_id,
    					this._qr_DiyCode_id,
    					this._Ip,
    					this._Ipaddress,
    					this._CreateOn};
        }

        /// <summary>
        /// 给当前实体赋值
        /// </summary>
        protected override void SetValues(MySoft.Data.IRowReader reader)
        {
            if ((false == reader.IsDBNull(_.record_id)))
            {
                this._record_id = reader.GetInt32(_.record_id);
            }
            if ((false == reader.IsDBNull(_.qr_DiyCode_id)))
            {
                this._qr_DiyCode_id = reader.GetInt32(_.qr_DiyCode_id);
            }
            if ((false == reader.IsDBNull(_.Ip)))
            {
                this._Ip = reader.GetString(_.Ip);
            }
            if ((false == reader.IsDBNull(_.Ipaddress)))
            {
                this._Ipaddress = reader.GetString(_.Ipaddress);
            }
            if ((false == reader.IsDBNull(_.CreateOn)))
            {
                this._CreateOn = reader.GetDateTime(_.CreateOn);
            }
        }

        public override int GetHashCode()
        {
            return base.GetHashCode();
        }

        public override bool Equals(object obj)
        {
            if ((obj == null))
            {
                return false;
            }
            if ((false == typeof(qr_record).IsAssignableFrom(obj.GetType())))
            {
                return false;
            }
            if ((((object)(this)) == ((object)(obj))))
            {
                return true;
            }
            return false;
        }

        public class _
        {

            /// <summary>
            /// 表示选择所有列，与*等同
            /// </summary>
            public static MySoft.Data.AllField All = new MySoft.Data.AllField<qr_record>();

            /// <summary>
            /// 扫码记录ID - 字段名：record_id - 数据类型：Int32
            /// </summary>
            public static MySoft.Data.Field record_id = new MySoft.Data.Field<qr_record>("record_id");

            /// <summary>
            /// 关联自定义二维码id - 字段名：qr_DiyCode_id - 数据类型：Int32
            /// </summary>
            public static MySoft.Data.Field qr_DiyCode_id = new MySoft.Data.Field<qr_record>("qr_DiyCode_id");

            /// <summary>
            /// ip端口 - 字段名：Ip - 数据类型：String
            /// </summary>
            public static MySoft.Data.Field Ip = new MySoft.Data.Field<qr_record>("Ip");

            /// <summary>
            /// ip地址 - 字段名：Ipaddress - 数据类型：String
            /// </summary>
            public static MySoft.Data.Field Ipaddress = new MySoft.Data.Field<qr_record>("Ipaddress");

            /// <summary>
            /// 创建时间 - 字段名：CreateOn - 数据类型：DateTime(可空)
            /// </summary>
            public static MySoft.Data.Field CreateOn = new MySoft.Data.Field<qr_record>("CreateOn");
        }
    }
}
